import {request} from "@/utils/request";
import type {Version} from "@/types/version";

/**
 * 上传文件
 * @param file
 * @returns
 */
export const upload = (file:File) => {
    return request({
        url: "/upload",
        method: "POST",
        data: {
            file: file
        }
    })
}

/**
 * 检查版本
 * @param version 当前版本
 */
export const checkAppVersionApi = (version: string) => {
  return request<Version>({
        method: 'POST',
        url: '/app/version?version='+version
    })
}